<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/exam.css">
<script type="text/javascript" src="/Template/js/amazeui.js"></script>
<script type="text/javascript">


    $(function() {

        //初始化页面配置
        initPage("测量对线");

        var app = new Vue({
            el: '#container',
            data: {
            },
            methods: {
                cancel: function() {
                    window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                },
                save: function() {
                    var examMeasureId = $("input[name=examMeasureId]").val();
                    var workorderId = $("input[name=workorderId]").val();

                    var burden = $("select[name=burden]").val();
                    var shank0 = $("input[name=shank0]").val();
                    var shank1 = $("input[name=shank1]").val();
                    var shank2 = $("input[name=shank2]").val();
                    var shank3 = $("input[name=shank3]").val();
                    var shank4 = $("input[name=shank4]").val();
                    var shank5 = $("input[name=shank5]").val();
                    var shank6 = $("input[name=shank6]").val();
                    var shank7 = $("input[name=shank7]").val();
                    var shank8 = $("input[name=shank8]").val();
                    var shank9 = $("input[name=shank9]").val();
                    var shank10 = $("input[name=shank10]").val();
                    var shank11 = $("input[name=shank11]").val();
                    var shank12 = $("input[name=shank12]").val();
                    var shank13 = $("input[name=shank13]").val();
                    var shank14 = $("input[name=shank14]").val();
                    var shank15 = $("input[name=shank15]").val();
//                    var shank16 = $("input[name=shank16]").val();
                    var shank17 = $("input[name=shank17]").val();
                    var shank18 = $("input[name=shank18]").val();
                    var shank19 = $("input[name=shank19]").val();
                    var shank20 = $("input[name=shank20]").val();


                    var completed = "1";
                    if(isNullOrEmpty(burden
                            &&shank0
                            && shank1
                            && shank2
                            && shank3
                            && shank4
                            && shank5
                            && shank6
                            && shank7
                            && shank8
                            && shank9
                            && shank10
                            && shank11
                            && shank12
                            && shank13
                            && shank14
                            && shank15
//                            && shank16
//                            && shank17
//                            && shank18
//                            && shank19
//                            && shank20

//                            && sva
                        )) {
                        completed = "-1";
                    }
                    if(isNullOrEmpty(burden)) {
                        alert("请选择负重状态");
                        return false;
                    }

                    $.ajax({
                        url:"/wechat/workorder/examMeasurePost",
                        type:"post",
                        data:{
                            examMeasureId: examMeasureId,
                            workorderId: workorderId,
                            burden: burden,
                            shank0: shank0,
                            shank1: shank1,
                            shank2: shank2,
                            shank3: shank3,
                            shank4: shank4,
                            shank5: shank5,
                            shank6: shank6,
                            shank7: shank7,
                            shank8: shank8,
                            shank9: shank9,
                            shank10: shank10,
                            shank11: shank11,
                            shank12: shank12,
                            shank13: shank13,
                            shank14: shank14,
                            shank15: shank15,
//                            shank16: shank16,
//                            shank17: shank17,
//                            shank18: shank18,
//                            shank19: shank19,
//                            shank20: shank20,

                            completed:completed,
                        },
                        dataType:"JSON",
                        beforefootSend:function(){
                            $("#loadingToast").show();
                        },
                        complete:function(){
                            $('#loadingToast').hide();
                        },
                        success:function(data){
                            if(data.code == 200) {
//                                alert(data.alert);
                                alert("保存成功");
                                window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                            }
                        },
                    })

                }
            }
        })
        $(".item select").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().val(value);
        });
    })

</script>

<div class="container" id="container">
    <div class="hint-info">
        <span class="update_time">{$formDict.update_time}：{$examMeasure.update_time}</span>
        <span class="employee_name">{$formDict.update_name}：{$employeeName}</span>
    </div>

    <div class="edit-info">
        <div class="edit-content">
            <input type="text" style="display: none;" name="workorderId" value="{$workorderId}">
            <input type="text" style="display: none;" name="examMeasureId" value="{$examMeasureId}">
            <div class="item">
                <span>负重状态：</span>
                <input id="burden" type="text" value="{$examMeasure.burden}" readonly placeholder="请选择">
                <select name="burden">
                    <option value="{$examMeasure.burden}">请选择</option>
                    {:getFormDictSelectOption($examMeasure['burden'],'burden','exam_measure',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <img class="bg-img" src="http://xwk-file.oss-cn-qingdao.aliyuncs.com/Home/exam_measure_wechat.jpg" alt="bg">
            <div class="item" style="border-bottom:0px"><span>1.{$formDict.shank_0}:</span><input name="shank0" type="text" value="{$examMeasure.shank_0}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>2.{$formDict.shank_1}:</span><input name="shank1" type="text" value="{$examMeasure.shank_1}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>3.{$formDict.shank_2}:</span><input name="shank2" type="text" value="{$examMeasure.shank_2}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>4.{$formDict.shank_3}:</span><input name="shank3" type="text" value="{$examMeasure.shank_3}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>5.{$formDict.shank_4}:</span><input name="shank4" type="text" value="{$examMeasure.shank_4}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>6.{$formDict.shank_5}:</span><input style="width: 32%;" name="shank5" type="text" value="{$examMeasure.shank_5}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span style="width: 65%;">7.{$formDict.shank_6}:</span><input style="width: 32%;" name="shank6" type="text" value="{$examMeasure.shank_6}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>8.{$formDict.shank_7}:</span><input name="shank7" type="text" value="{$examMeasure.shank_7}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>9.{$formDict.shank_8}:</span><input name="shank8" type="text" value="{$examMeasure.shank_8}" placeholder="请输入数据(mm)" ></div>
            <div class="item"><span>10.{$formDict.shank_9}:</span><input name="shank9" type="text" value="{$examMeasure.shank_9}" placeholder="请输入数据(mm)" ></div>
            <img class="bg-img" src="http://xwk-file.oss-cn-qingdao.aliyuncs.com/Home/drafo2_wechat.jpg" alt="bg">
            <div class="item" style="border-bottom:0px"><span style="width: 65%;">11.{$formDict.shank_10}:</span><input style="width: 32%;" name="shank10" type="text" value="{$examMeasure.shank_10}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span style="width: 65%;">12.{$formDict.shank_11}:</span><input style="width: 32%;" name="shank11" type="text" value="{$examMeasure.shank_11}" placeholder="请输入数据(mm)" ></div>
            <div class="item"><span style="width: 65%;">13.{$formDict.shank_12}:</span><input style="width: 32%;" name="shank12" type="text" value="{$examMeasure.shank_12}" placeholder="请输入数据(mm)" ></div>
            <div class="item"><span style="width: 65%;">14.内踝下到第一跖骨头:</span><input style="width: 32%;" name="shank13" type="text" value="{$examMeasure.shank_13}" placeholder="请输入数据(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span style="width: 95%;">15.外踝下到第五跖骨头距离(各中心点地面垂线):</span></div>
            <div class="item"><span style="width: 65%;"></span><input style="width: 32%;" name="shank14" type="text" value="{$examMeasure.shank_14}" placeholder="请输入数据(mm)" ></div>
            <div class="item"><span style="width: 65%;">16.舟骨高度:</span><input style="width: 32%;" name="shank15" type="text" value="{$examMeasure.shank_15}" placeholder="请输入数据(mm)" ></div>
            <!--div class="item"><span style="width: 65%;">17.舟骨高度(非负重):</span><input style="width: 32%;" name="shank16" type="text" value="{$examMeasure.shank_16}" placeholder="请输入数据(mm)" ></div>
            <div class="item"><span style="width: 65%;">18.膝关节跖屈:</span><input style="width: 32%;" name="shank17" type="text" value="{$examMeasure.shank_17}" placeholder="请输入度数" ></div>

            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="width: 100%; margin-left: 30%">—— 膝关节背伸 ——</span>
            </div>
            <div class="item" style="border-bottom:0px"><span> 0°膝R1：</span><input name="shank18" type="text" value="{$examMeasure.shank_18}" placeholder="请输入度数"></div>
            <div class="item" style="border-bottom:0px"><span> 0°膝R2：</span><input name="shank19" type="text" value="{$examMeasure.shank_19}" placeholder="请输入度数"></div>
            <div class="item" style="border-bottom:0px"><span>90°膝R1：</span><input name="shank20" type="text" value="{$examMeasure.shank_20}" placeholder="请输入度数"></div>
            <div class="item"><span>90°膝R2：</span><input name="shank21" type="text" value="{$examMeasure.shank_21}" placeholder="请输入度数"></div-->

            <!--div class="item" style="border-bottom:0px">
                <span style="width: 100%; margin-left: 25%">—— 矫形器目标对线 ——</span>
            </div>
            <div class="item" style="border-bottom:0px"><span>AA：</span><input name="shank17" type="text" value="{$examMeasure.shank_17}" placeholder="请输入度数"></div>
            <div class="item" style="border-bottom:0px"><span>SVA：</span><input name="shank18" type="text" value="{$examMeasure.shank_18}" placeholder="请输入度数"></div>
            <div class="item" style="border-bottom:0px"><span>跟骨冠状面：</span><input name="shank19" type="text" value="{$examMeasure.shank_19}" placeholder="请输入描述"></div>
            <div class="item" style="border-bottom:0px"><span>前足冠状面：</span><input name="shank20" type="text" value="{$examMeasure.shank_20}" placeholder="请输入描述"></div-->

            <!--div class="item">
                <span>前足冠状面：</span>
                <input id="head" type="text" value="{$examMeasure.head}" readonly placeholder="请选择">
                <select name="head">
                    <option value="{$examMeasure.head}">请选择</option>
                    {:getFormDictSelectOption($examMeasure['head'],'head','exam_measure',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div-->

            <div class="line"></div>
        </div>
    </div>
    <div class="operation-btn">
        <div class="cancle-btn" v-on:click="cancel">取消</div>
        <if condition="$workorder['status'] lt '2' && $workorder['creator_id'] eq $customerId">
            <div class="save-btn" v-on:click="save">保存</div>
            <elseif condition="$workorder['status'] lt '3' && $job[0] eq 100"/>
            <div class="save-btn" v-on:click="save">保存</div>
        </if>
        <!--if condition="$workorder['status'] eq '2' && $workorder['examinator_id'] eq $customerId && $workorder['exam_time'] eq ''">
            <div class="save-btn" v-on:click="save">保存</div>
        </if-->
    </div>

</div>
<include file="./Template/footer.html" />